// 导入路由依赖
import { useRoutes } from "react-router-dom";
// 导入所需组件，首页  关于
import LoginView from "../views/login";
import SysView from "../views/user/sys/index";
import UpdateUserInfoView from "../views/user/updateUserInfo/index";
import HomeView from "../views/dhlb/index";
import DuijiangView from "../views/duijiang/index";
// import LotteryView from "../views/cj/jp/index";
// 创建路由
const routes = [
    {
      path: "/",
      element: (<LoginView></LoginView>)
    },
    {
      path: "/home",
      element: (<HomeView></HomeView>)
    },


    {
      path: "/user/sys",
      element: (<SysView ></SysView >)
    },
    {
      path: "/user/updateUserInfo",
      element: (<UpdateUserInfoView ></UpdateUserInfoView >)
    },
    {
      path: "/dj/:sha",
      element: (<DuijiangView ></DuijiangView >)
    }

  ];
  // 使用useRoutes 创建
export default function RouterView() {
    // 创建路由
    const elem = useRoutes(routes);
    // 返回接口
    return elem;
  }
  